package com.yingside.clazz.system;

import java.util.Arrays;
import java.util.Properties;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        /*long start = System.currentTimeMillis();
        String str = "";
        for (int i = 0; i < 2000; i++) {
            str += "aa" + i;
        }
        long end = System.currentTimeMillis();
        long diff = end - start;
        System.out.println("时间差是:" + diff);*/

        //===================================================

        /*for (int i = 0; i < 5; i++) {
            System.out.println("请输入任意的字母");
            String str = input.next();
            if(str.equals("a")){
                System.exit(0);
            }
        }
        //直接程序退出，这个打印就不会再运行了
        System.out.println("aaaaaabbbbbbb");*/

        //===================================================

        /*new Gcfin();
        new Gcfin();
        new Gcfin();
        new Gcfin();
        new Gcfin();
        System.gc();*/

        //===================================================

        /*Properties properties = System.getProperties();
        properties.list(System.out);*/

        /*String path = System.getProperty("user.dir");
        System.out.println("path = " + path);*/

        //===================================================

        int [] nums1 = {88,99,111,222,333,444};
        int [] nums2 = {1,2,3,4,5};

        //通过System.arraycopy方法拷贝数组
        System.arraycopy(nums1,0,nums2,1,2);
        System.out.println(Arrays.toString(nums1));
        System.out.println(Arrays.toString(nums2));

        //通过Arrays.copy方法拷贝数组
        int [] nums3 = {11,22,33,44};
        int[] newNums = Arrays.copyOf(nums3, nums3.length);

        System.out.println(Arrays.toString(newNums));


    }
}
